package sugarbind_input

class Symptom {

    String symptom_Name
	String symptom_Notes
	
    static constraints = {
			symptom_Name(blank:false)
			symptom_Notes(nullable:true)
			
			symptom_Name(unique:true)
			
	}
	
	static hasMany = [diseases: Disease]
	static belongsTo = [Disease]
	
	static mapping = {
//		id column: 'disease_symptom_studied_id'
		id generator: 'sequence', params: [sequence: 'symptom_id_seq']
		
		diseases joinTable: [name: "disease_symptom", key: 'symptom_id' ]
	}
	
	public String toString(){
		symptom_Name //+ " " + disease
	}
}
